package com.diana.controller;

import com.diana.aop.Mylog;
import com.diana.service.ManagerRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author anzhi
 * @since 2019-04-21
 */
@RestController
public class ManagerRoleController {

    @Autowired
    private ManagerRoleService managerRoleService;

    @Mylog(remark = "添加角色")
    @RequestMapping("/admin/managerRole/addRole")
    public String addRole(@RequestBody Map<String,Object> map){
        return managerRoleService.addRole(map);
    }

    @Mylog(remark = "修改角色")
    @RequestMapping("/admin/managerRole/updateRole")
    public String updateRole(@RequestBody Map<String,Object> map){
        return managerRoleService.updateRole(map);
    }

    @Mylog(remark = "修改角色状态")
    @RequestMapping("/admin/managerRole/deleteRole")
    public String updateStatus(@RequestBody Map<String,Object> map){
        return managerRoleService.updateStatus(map);
    }

    @RequestMapping("/admin/managerRole/getRoleInfo")
    public String getRoleInfo(@RequestBody Map<String,Object> map){
        return managerRoleService.getRoleInfo(map);
    }

    @RequestMapping("/admin/managerRole/getRoleList")
    public String getRoleList(@RequestBody Map<String,Object> map){
        return managerRoleService.getRoleList(map);
    }
}

